package com.lgh.demo.activity;

import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.view.KeyEvent;
import com.lgh.demo.R;
import com.lgh.demo.databinding.ActivityDetailsBinding;
import com.lgh.demo.util.WMConstantUtil;
import com.lgh.demo.viewModel.VMSellersDetail;

public class DetailsActivity extends BaseActivity {

    private VMSellersDetail vmSellersDetail;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        ActivityDetailsBinding detailsBinding = DataBindingUtil.setContentView(this, R.layout.activity_details);
        vmSellersDetail = new VMSellersDetail(this, detailsBinding,
                getIntent().getLongExtra(WMConstantUtil.KEY_POI_ID, 0));
        detailsBinding.setVmSellersDetail(vmSellersDetail);
    }

    @Override
    public boolean dispatchKeyEvent(KeyEvent event) {
        vmSellersDetail.listenerKeyEvent(event);
        return super.dispatchKeyEvent(event);
    }
}
